/*
 * Copyright 2020-2099 sa-token.cc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xjq.listener;


import lombok.extern.slf4j.Slf4j;

/**
 * Sa-Token 侦听器的一个实现：Log 打印
 * 
 * @author click33
 * @since 1.33.0
 */
@Slf4j
public class AppListenerForDB implements AppListener {

	/**
	 * 每次登录时触发 
	 */
	@Override
	public void doLogin(String loginType, Object loginId, String tokenValue) {
		log.info("写入 DB ::: doLogin loginType={}, loginId={}, tokenValue={}", loginId, loginType, tokenValue);
	}

	/**
	 * 每次注销时触发 
	 */
	@Override
	public void doLogout(String loginType, Object loginId, String tokenValue) {
		log.info("写入 DB ::: 账号 {} 注销登录 (loginType={}), 会话凭证 token={}", loginId, loginType, tokenValue);
	}



}
